package com.avyss.flyingpoints.scene;

public class DynamicsParams {
	private static final int    NUMBER_OF_FOLLOWERS = 50;

	// speed increment per pixel of distance, in units of maximum speed
	private static final float 	LEADER_ATTRACTION_COEFF  	= 0.003f; // increment in velocity, in units of parts-of-MAX_VELOCITY per msec 
	private static final float 	LEADER_NONATTRACTING_ZONE	= 0.01f; // fraction of full screen size  
	private static final long	LEADER_STABILITY = 500;	// msec till change of leader's direction
	private static final int	LEADER_ANGLE_INCR = 20;	// degrees

	private static final float	DESIRED_TIME_TO_CROSS_SCREEN = 5.0f * 1000;   // msecs
	
	private static final float	COLOR_PHASE_CHANGE_RATE = 0.10f;   // degrees per msec
	
	private static final float	POINT_TRACE_LEN_FRACTION = 0.02f;   // fraction of full screen size
	
	
	private final int windowWidth;
	private final int windowHeight;
	private final int windowCharacteristicSize;
	
	public DynamicsParams(int windowWidth, int windowHeight) {
		this.windowWidth  = windowWidth;
		this.windowHeight = windowHeight;
		this.windowCharacteristicSize = (windowWidth + windowHeight) / 2;
	}

	public int getWindowWidth() {
		return windowWidth;
	}

	public int getWindowHeight() {
		return windowHeight;
	}
	
	public float getPointTraceLen() {
		return windowCharacteristicSize * POINT_TRACE_LEN_FRACTION;
	}

	public float getColorPhaseRate() {
		return COLOR_PHASE_CHANGE_RATE;
	}

	public int getNumOfFollowers() {
		return NUMBER_OF_FOLLOWERS;
	}
	
	public float getMaxVelocity() {
		return windowCharacteristicSize / DESIRED_TIME_TO_CROSS_SCREEN;
	}

	public float getLeaderAttractionCoeff() {
		return LEADER_ATTRACTION_COEFF;
	}

	public float getLeaderNonattractingDistance() {
		return windowCharacteristicSize * LEADER_NONATTRACTING_ZONE;		
	}
	
	public long getLeaderDirectionChangeTime() {
		return LEADER_STABILITY;
	}

	public int getLeaderDeflectionAngle() {
		return LEADER_ANGLE_INCR;
	}
}
